//
//  RangingMacros.h
//  Ranging_dev
//
//  Created by Mr.Dynasty on 2019/4/1.
//  Copyright © 2019 Mr.Dynasty. All rights reserved.
//

#ifndef RangingMacros_h
#define RangingMacros_h

#pragma mark - 通用宏
#ifdef DEBUG
#define NSLog(FORMAT, ...) NSLog(@"%s:m.%d\n %@\n", __FUNCTION__,__LINE__, [NSString stringWithFormat:FORMAT, ##__VA_ARGS__])
#else
#define NSLog(format,...)
#endif

#define HighVersion   ([[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){.majorVersion = 9, .minorVersion = 0, .patchVersion = 0}] ? true : false)
#define RGBACOLOR(r,g,b,a)      [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:(a)]
#define HEX_COLOR(hex)          ([UIColor colorWithRed:((float)((hex & 0xFF0000) >> 16))/255.0 green:((float)((hex & 0xFF00) >> 8))/255.0 blue:((float)(hex & 0xFF))/255.0 alpha:1])
#define HEX_COLORVALUES(hex,a)    ([UIColor colorWithRed:((float)((hex & 0xFF0000) >> 16))/255.0 green:((float)((hex & 0xFF00) >> 8))/255.0 blue:((float)(hex & 0xFF))/255.0 alpha:a])
#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width
#define SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height

#define IPhoneX ((SCREEN_HEIGHT >= 812) ? true : false)
#define STAUEBAR_HEIGHT (IPhoneX ? 44 : 20)
#define TOPBAR_HEIGHT (IPhoneX ? 88 : 64)
#define TABBAR_HEIGHT (IPhoneX ? 83 : 49)
#define kTopMargin (IPhoneX ? 24 : 0)
#define kBottomMargin (IPhoneX ? 34 : 0)

#define BigScreenX ((SCREEN_WIDTH >= 375) ? true : false)
#define BigScreenY ((SCREEN_HEIGHT >= 667) ? true : false)

#define xSize (BigScreenX ? 1 : [UIScreen mainScreen].bounds.size.width/375)
#define ySize (BigScreenY ? 1 : [UIScreen mainScreen].bounds.size.height/667)

#define DefaultColor [UIColor colorWithRed:26/255.0 green:139/255.0 blue:255/255.0 alpha:1]
#define DefaultBackColor        HEX_COLORVALUES(0xf3f3f3,1)
#define PlaceHolderColor        HEX_COLORVALUES(0x999999,1)
#define TextGrayColor           HEX_COLORVALUES(0x888888,1)
#define TextBlackColor          HEX_COLORVALUES(0x444444,1)
#define TextHighLighterColor    HEX_COLORVALUES(0xFF0000,1)
#define CalendarTodayColor      HEX_COLORVALUES(0xEFBF6F,1)
#define WeekMissionColor        HEX_COLORVALUES(0xEFBF6F,1)
#define Top1Color               HEX_COLORVALUES(0x3FCDCF,1)
#define Top2Color               HEX_COLORVALUES(0xEEA1A1,1)
#define Top3Color               HEX_COLORVALUES(0xE1D59A,1)
#define GrayLineColor           HEX_COLORVALUES(0xe6e6e6,1)

#define MediumSuperBigFont    (HighVersion ? [UIFont fontWithName:@"PingFangSC-Medium" size:24] : [UIFont systemFontOfSize:24])
#define MediumMiddleBigFont   (HighVersion ? [UIFont fontWithName:@"PingFangSC-Medium" size:22] : [UIFont systemFontOfSize:22])
#define MediumBigFont         (HighVersion ? [UIFont fontWithName:@"PingFangSC-Medium" size:18] : [UIFont systemFontOfSize:18])
#define MediumDefaultFont     (HighVersion ? [UIFont fontWithName:@"PingFangSC-Medium" size:15] : [UIFont systemFontOfSize:15])
#define MediumMiddelFont      (HighVersion ? [UIFont fontWithName:@"PingFangSC-Medium" size:12] : [UIFont systemFontOfSize:12])
#define MediumSmallFont       (HighVersion ? [UIFont fontWithName:@"PingFangSC-Medium" size:12] : [UIFont systemFontOfSize:12])

#define RegularBigFont        (HighVersion ? [UIFont fontWithName:@"PingFangSC-Regular" size:18] : [UIFont systemFontOfSize:18])
#define RegularDefaultFont    (HighVersion ? [UIFont fontWithName:@"PingFangSC-Regular" size:15] : [UIFont systemFontOfSize:15])
#define RegularMiddelFont     (HighVersion ? [UIFont fontWithName:@"PingFangSC-Regular" size:12] : [UIFont systemFontOfSize:12])
#define RegularSmallFont      (HighVersion ? [UIFont fontWithName:@"PingFangSC-Regular" size:12] : [UIFont systemFontOfSize:12])

#define WebUrl  @"https://www.baidu.com"

#endif /* RangingMacros_h */
